package com.coderman.domainservice.blogtopic.domain.convertor;

import com.coderman.domainservice.blogtopic.client.dto.BlogDTO;
import com.coderman.domainservice.blogtopic.client.dto.BlogSpecialColumnDTO;
import com.coderman.domainservice.blogtopic.domain.model.entity.BlogBO;
import com.coderman.domainservice.blogtopic.domain.model.entity.BlogSpecialColumnBO;
import com.coderman.domainservice.blogtopic.infrast.mapper.dataobject.BlogDO;
import com.coderman.domainservice.blogtopic.infrast.mapper.dataobject.BlogSpecialColumnDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * Description:
 * date: 2021/3/29
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 * 基于mapstrcut 实现数据模型转换
 * 这里放在领域层可以方便
 * dto->bo,bo->dto
 * do->bo,bo->do
 */
@Mapper
public interface BlogSpecialColumnConvertor {
    BlogSpecialColumnConvertor INSTANCE = Mappers.getMapper(BlogSpecialColumnConvertor.class);
    /**
     * dto-->bo
     * @param blogDTO
     * @return
     */
    BlogSpecialColumnBO dto2bo(BlogSpecialColumnDTO blogDTO);

    /**
     * bo-->do
     * @param blogSpecialColumnBO
     * @return
     */
    BlogSpecialColumnDO bo2do(BlogSpecialColumnBO blogSpecialColumnBO);

    /**
     * do-->bo
     * @param blogDO
     * @return
     */
    BlogSpecialColumnBO do2bo(BlogSpecialColumnDO blogDO);
}
